package br.com.foxinline.servico;

import br.com.foxinline.modelo.DoencaPulmonar;
import java.util.List;
import javax.ejb.Stateless;

/**
 *
 * @author laverson
 */
@Stateless
public class DoencaPulmonarServico extends ServicoGenerico<DoencaPulmonar> {

    public DoencaPulmonarServico() {
        super(DoencaPulmonar.class);
    }

    public List<DoencaPulmonar> autoComplete(String query) {
        List<DoencaPulmonar> results = getEntityManager().createQuery("select d from " + DoencaPulmonar.class.getSimpleName() + " d where lower(d.nome) like '%" + query.toLowerCase().trim() + "%'").getResultList();
        return results;
    }
}
